package com.ruoyi.user.controller;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.manage.domain.School;
import com.ruoyi.manage.domain.vo.SchoolVo;
import com.ruoyi.manage.service.ISchoolService;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author ZhangZhongGen
 */
@RestController
@Slf4j
@RequestMapping("/userWeixin/school")
public class UserSchoolController extends BaseController {

    @Autowired
    private ISchoolService schoolService;

    /**
     * 查询学校管理列表
     */
    @ApiOperation("查询学校管理列表")
    @GetMapping("/list")
    public TableDataInfo list(School school)
    {
        List<School> list = schoolService.selectSchoolList(school);
        return getDataTable(list);
    }

    /**
     * 查询学校-小屋级联列表
     * @param school
     * @return
     */
    @ApiOperation("查询学校-小屋级联列表")
    @GetMapping("/listVo")
    public TableDataInfo listVo(School school)
    {
        List<SchoolVo> list = schoolService.selectSchoolVoList(school);
        return getDataTable(list);
    }

}
